#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->progressBar->setValue(0);
    timer = new QTimer(this);
    connect(timer,&QTimer::timeout,this,&Widget::handleTimer);
    timer->start(100);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleTimer()
{
    int val = ui->progressBar->value();
    if(val== 100)
        close();
    ui->progressBar->setValue(++val);
}

